<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>后台管理中心</title>
<?php echo $this->_var['system_css']; ?>
<?php echo $this->_var['system_js']; ?>
</head>
<body>
<?php echo $this->fetch('message.html'); ?>
<div class="pad-lr-10" style="margin-top: 15px;">
  
    <table width="100%" cellspacing="0" class="search-form">
      <tbody>
        <tr>
          <td>
              <div class="explain-col">
            
                  <form name="searchform" action="<?php echo $this->_var['site_url']; ?>admin/news/search/" method="post" >
                   &nbsp;&nbsp;选择分类：
                  <select name="category_id" id="category_id">
                    <option value="">==全部==</option>
                     <?php echo $this->_var['category_option']; ?>     
                  </select>
                  
                   &nbsp;&nbsp;上下架状态：
                  <select name="is_onsale" id="is_onsale">
                    <option value="">==全部==</option>
                    <option value="1">在售产品</option>
                    <option value="0">下架产品</option>
                  </select>
                  
                   &nbsp;&nbsp;锁定状态：
                  <select name="is_onsale" id="is_onsale">
                    <option value="">==全部==</option>
                    <option value="1">锁定产品</option>
                    <option value="0">未锁产品</option>
                  </select>
                  
                  
                  
                  <br/> <br/>
                   &nbsp;&nbsp;关键词：
                  <input name="keywords" type="text"  class="input-text" />
                  <input type="submit" name="search" class="button" value="搜索" />
                   </form>
                </div>
            </td>
        </tr>
      </tbody>
    </table>
 
  <div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
        <tr>
          <th width="45">ID</th>
          <th>名称</th>
          <th>图片</th>
          <th>添加时间</th>
          <th>管理操作</th>
        </tr>
      </thead>
      <tfoot>
        <tr align="right">
          <td colspan="5"><?php echo $this->_var['page']; ?></td>
        </tr>
      </tfoot>
      <tbody>
      <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
      <tr>
        <td align="center"><?php echo $this->_var['list']['id']; ?></td>
        <td align="center"><?php echo $this->_var['list']['name']; ?> &nbsp;&nbsp;(<?php if ($this->_var['list']['is_lock'] == 1): ?> <a href="javascript:void(0);" title="<?php echo $this->_var['list']['name']; ?>" id="<?php echo $this->_var['list']['id']; ?>" class='unlock' style="color:red;">解锁</a><?php else: ?><a href="javascript:void(0);" title="<?php echo $this->_var['list']['name']; ?>" id="<?php echo $this->_var['list']['id']; ?>" class='lock' style="color:red;">锁定</a><?php endif; ?>)</td>
        <td align="center"><img src="<?php echo $this->_var['list']['goods_image']; ?>" width="80" height="80"></td>
        <td align="center"><?php echo Date::timeformat($this->_var['list']['add_time'],2); ?></td>
        <td align="center"><a href="<?php echo $this->_var['site_url']; ?>admin/shop/edit/<?php echo $this->_var['list']['id']; ?>">修改</a> | <a class="delete" href="javascript:void(0);" title="<?php echo $this->_var['list']['name']; ?>" id="<?php echo $this->_var['list']['id']; ?>">删除</a></td>
      </tr>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </tbody> 
    </table>
    <div id="pages"></div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	$('.delete').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要删除<font color=red>'+title+'</font>吗？', function(){
			location.href="<?php echo $this->_var['site_url']; ?>admin/shop/delete/"+id;
		}, function(){
		});
	});
	
	
	$('.lock').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要锁定<font color=red>'+title+'</font>吗？', function(){
			location.href="<?php echo $this->_var['site_url']; ?>admin/shop/lock/"+id;
		}, function(){
		});
	});
	
	$('.unlock').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要解锁<font color=red>'+title+'</font>吗？', function(){
			location.href="<?php echo $this->_var['site_url']; ?>admin/shop/unlock/"+id;
		}, function(){
		});
	});
});
</script>
</body>
</html>